tests: Extend test framework for driverless board qualification scenarios.#89
tests: Extend test framework for driverless board qualification scenarios.#89
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class support in the YAML scenario runner for “board qualification” scenarios that run on real hardware without a driver context.
Changes:
- Extend scenario parametrization to support
type: board, generate friendlier scenario names, and apply aboardmarker. - Add
MpremoteBridge.run_raw_script()to execute hardware scripts without mounting/initializing a driver. - Register the new
boardpytest marker intests/conftest.py.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/test_scenarios.py | Adds board-type scenario handling (hardware-only filtering, board mark, and raw-script execution for hardware_script). |
| tests/runner/mpremote_bridge.py | Introduces run_raw_script() for running plain MicroPython scripts and JSON-decoding result. |
| tests/conftest.py | Registers the board marker for pytest. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Corrections suite à la review Copilot (bc70f05) :
|
|
Réponses aux commentaires Copilot : Board scenarios manquent le marker Actions non supportées ( |
There was a problem hiding this comment.
Pull request overview
Adds a new “board qualification” scenario type to the YAML scenario test framework, enabling hardware-only checks that run raw MicroPython scripts without requiring a driver context.
Changes:
- Extend
tests/test_scenarios.pyto supporttype: boardscenarios (hardware-only), including new param IDs/marks and raw-script execution. - Add
MpremoteBridge.run_raw_script()to execute board scripts without mounting/importing a driver. - Introduce new board qualification scenario YAMLs (pins, LEDs, I2C scan/IDs, buzzer, buttons) plus a new
boardpytest marker.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_scenarios.py | Adds type: board handling, adjusts test IDs/marks, and routes board hardware_script to raw execution. |
| tests/runner/mpremote_bridge.py | Adds run_raw_script() for executing scripts without driver context and returning JSON-decoded result. |
| tests/conftest.py | Registers new board marker. |
| tests/scenarios/board_pins.yaml | Adds hardware-only smoke tests for ADC and digital pull-up reads on board pins. |
| tests/scenarios/board_leds.yaml | Adds hardware-script + manual verification coverage for board LEDs. |
| tests/scenarios/board_i2c_scan.yaml | Adds I2C scan and basic ID/register presence checks for expected devices. |
| tests/scenarios/board_buzzer.yaml | Adds buzzer tone/sweep/melody scripts with manual confirmation steps. |
| tests/scenarios/board_buttons.yaml | Adds polling + interrupt button tests, including D-PAD reads via MCP23009E. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Réponses aux commentaires Copilot (2e review) :
Markers D-PAD tests sans reset du MCP23009E — Corrigé : ajout de |
|
🎉 This PR is included in version 0.0.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Closes #83
Extends the test framework to support board-level qualification tests — scenarios that test hardware components (LEDs, buttons, buzzer, pins, I2C bus) without requiring a driver.
Changes
tests/conftest.py: Registerboardpytest marker for filteringtests/runner/mpremote_bridge.py: Addrun_raw_script(script)method that executes raw MicroPython code on the board without I2C/driver initializationtests/test_scenarios.py:iter_scenario_tests(): Handletype: boardYAML scenarios (hardware-only,board+hardwaremarkers)test_scenario(): Route boardhardware_scriptactions torun_raw_script(), guard unsupported actions (call,read_register,interactive) for board scenarios_print_result(): Skip printing bare boolean results (not informative for smoke tests)New scenario format
Board scenarios use
type: boardand have nodriver/driver_class:Test suite separation
pytest tests/ -k mockpytest tests/ --port ... -k "not board"pytest tests/ --port ... -k board -s -vHow to test
Test results
Test plan
ruff check tests/— passedpytest tests/ -k mock— 41 passed (no regression)pytest tests/ -k board(sans --port) — board tests correctly skippedpytest tests/ -k "not board"— existing driver tests unchanged